The present invention generally relates to an image processing apparatus, and more particularly to an image processing apparatus for image compression and decompression in which occurrence a moire in a reconstructed image due to an image processing of a screened halftone image is automatically eliminated.
In an image processing apparatus for image compression and decompression, an original image is grouped into a set of blocks, image data of each block is transformed into a set of DCT (discrete cosine transform) coefficients, and the DCT coefficients of each block are quantized so that a compressed image is generated from such quantized DCT coefficients. FIG. 1 shows a conventional image processing apparatus. In the image processing apparatus shown in FIG. 1, image data read by an image reader 101 is encoded into a compressed image by an encoding part 102, and the compressed image is stored in a storage part 106 such as a magnetic disk. The compressed image stored in the storage part 106 is decoded into a reconstructed image by a decoding part 103, and the reconstructed image supplied by the decoding part 103 is processed by an image processor 104. The image supplied by the image processor 104 is output to an output part 105 so that a reproduced image is generated by the output part 105.
The image reader 101 includes a CCD (charge coupled device) image sensor. The image reader 101 reads out an image from an original document by means of the CCD image sensor. In the image reader 101, an analog signal indicating each pixel (picture element) of the image is amplified within a prescribed range, and the analog signal is converted into a digital signal. Also, in the image reader 101, a shading correction process for the digital signal is performed so as to suit the characteristics of an optical system of the image reader and the variations of sensitivity of the CCDs in the CCD image sensor. After the shading correction process is performed, the digital signal is supplied by the image reader 101 to the encoding part 102.
FIG. 2 shows the encoding part 102 of the image processing apparatus shown in FIG. 1. In FIG. 2, a block reader 201 of the encoding part 102 reads out one block from the original image, each block including 64 pixels arranged in 8.times.8 formation. FIG. 3 shows an original image which is grouped into a set of blocks, each of which includes 64 pixels arranged in 8.times.8 formation.
A DCT transformer 202 transforms the 64 pixels (x.sub.ij) of each block of the original image into DCT coefficients (y.sub.uv) through DCT (discrete cosine transformation). The DCT coefficients Y.sub.uv are represented by the following equation: ##EQU1## where u=0,1, . . . ,
v=0,1, . . . , 7; PA1 C(w)=1/2 when w=0; PA1 C(w)=1 when w=1,2, . . . , 7
FIG. 4 shows a set of DCT coefficients of one block. One of the DCT coefficients of (0, 0) in the block is called a DC component, and this DC component indicates an average of densities of pixels of the block. The remaining 63 DCT coefficients are called AC components, and the AC components include low-frequency coefficients located in upper, left-hand areas of the block, and high-frequency coefficients located in lower, right-hand areas of the block.
In FIG. 4, the AC components of the DCT coeffficients horizontally aligned in a direction (u-direction) indicated by an arrow u in FIG. 4 show changes of densities for pixels arranged in a main scanning direction. The AC components of the DCT coefficients vertically aligned on a line in a direction (v-direction) indicated by an arrow v in FIG. 4 show changes of densities for pixels arranged in a sub scanning direction. Also, the AC components of the DCT coefficients diagonally aligned in the block show changes of densities in which the density changes in the main scanning direction and the density changes in the sub scanning direction overlap each other.
The DCT coefficients output by the DCT transformer 202 shown in FIG. 2 are respectively quantized by a quantizer 203. A quantization matrix table is stored in a table memory 206, and a set of quantization factors are defined in the quantization matrix table. A set of scale factors are adjusted and supplied by a scale factor controller 205. Each of the quantization factors from the table memory 206 is multiplied by each of the scale factors supplied by the scale factor controller 205. The quantizer 203 generates a set of quantized DCT coefficients by using the quantization factors multiplied by the scale factors. Thus, by adjusting the scale factors output by the scale factor controller 205, the quantity of the coded information and the picture quality of the reconstructed image are controlled.
FIG. 5 shows an example of the quantization matrix table stored in the table memory 206. Since the sensitivity of the human eyes is low with respect to an image generated from the high-frequency components of the DCT coefficients, the low-order quantization factors of this quantization matrix table are much smaller than the high-order quantization factors so as to suit the characteristics of the human eyes.
An encoder 204 of the encoding part 102 shown in FIG. 2 performs a modified Huffmann encoding process so that the quantized DCT coefficients output by the quantizer 203 are encoded. In the encoder 204, a relatively short code is generated from each of quantized DCT coefficients which appear more frequently in the image data stream, while a relatively long code is generated from each of quantized DCT coefficients which appear less frequently in the image data stream. The quantity of coded information is reduced in this manner. A compressed image output by the encoder 204 is stored in the storage part 106.
A decoder 208 of the decoding part 103 shown in FIG. 2 performs a modified Huffmann decoding process so that the coded information stored in the storage part 106 is decoded so that the quantized DCT coefficients before the encoding process is performed by the encoder 204 are produced. A dequantizer 209 calculates the DCT coefficients from the quantized DCT coefficients output by the decoder 208, by using the quantization factors from the table memory 206 multiplied by the scale factors from the scale factor controller 205 in the inverse manner to the above mentioned quantizer 203.
An inverse DCT transformer 210 generates a reconstructed image from the DCT coefficients output by the dequantizer 209 through inverse DCT transformation. A block recorder 211 outputs image data of each block of the reconstructed image output by the inverse DCT transformer 210. The image data, output by the inverse DCT transformer 210, is temporarily stored in eight line memories (not shown) each of which corresponds to a line of image data. After the image data is stored in all areas of the line memories, the image data of each line is output to the image processor 104 shown in FIG. 1. The image processor 104 performs the image processing such as a halftone imaging for the image data received from the decoding part 103. The output part 105 records the image supplied by the image processor 104.
Conventionally, when a screened halftone image such as a photograph is processed by the image processor, a moire may appear in a reconstructed image due to the interference between the sampling frequency of the image processing apparatus and the density change frequency of the screened halftone image, thus degrading the picture quality. In order to eliminate the above mentioned problem, a smoothing filter is provided to pre-process the screened halftone image and the image data being pre-processed through the smoothing filter is supplied to the image processor.
When a halftone imaging process such as a dither method, a density pattern method or a sub-matrix method is performed for a halftone dot image such as a photograph in which the density of the original image continuously changes, a reconstructed image having a desirable picture quality can be reproduced by the above image processing apparatus. However, when the halftone imaging process is performed for a bi-level line image such as a character in which the density of the original image sharply changes, a reconstructed image may have a faded outline portion and the picture quality may be seriously degraded. Thus, it is desirable to perform the halftone imaging process only when a halftone dot image is received, and to perform a simple hi-level imaging process without performing the halftone imaging process when a bi-level line image is received. However, there no suitable method for selectively perform the halftone imaging process and the simple hi-level imaging process in accordance with the kind of the image being received.
In the conventional apparatus described above, the high-frequency components of the DCT coefficients are removed so as to suit the characteristics of the human eyes and the DCT coefficients are quantized in a manner such that she image is efficently compressed. However, when the quantization is performed for an image having a great amount of high-frequency components and the image compressed at a high compression rate so that the high-frequency components are removed as shown in FIG. 6A, a ringing may appear in a reconstructed image as shown in FIG. 6B, thus degrading the picture quality.
Also, in the conventional apparatus described above, the occurrence of the moire due to the image processing of the screened halftone image is prevented by means of using a smoothing filter. However, it is diffuclt to select a smoothing filter appropriate for the kind of the image being received. When a smoothing filter appropriate for a screened halftone image having a great number of screened halftone lines is used for a screened halftone image having a small number of screened halftone lines, the occurrence of the moire cannot be prevented and the picture quality of the reconstructed image will be degraded.